26 research outputs found
Regular Expressions in a CS Formal Languages Course
Regular expressions in an Automata Theory and Formal Languages course are
mostly treated as a theoretical topic. That is, to some degree their
mathematical properties and their role to describe languages is discussed. This
approach fails to capture the interest of most Computer Science students. It is
a missed opportunity to engage Computer Science students that are far more
motivated by practical applications of theory. To this end, regular expressions
may be discussed as the description of an algorithm to generate words in a
language that is easily programmed. This article describes a programming-based
methodology to introduce students to regular expressions in an Automata Theory
and Formal Languages course. The language of instruction is FSM in which there
is a regular expression type. Thus, facilitating the study of regular
expressions and of algorithms based on regular expressions.Comment: In Proceedings TFPIE 2023, arXiv:2308.0611
Visualizing Why Nondeterministic Finite-State Automata Reject
Students find their first course in Formal Languages and Automata Theory
challenging. In addition to the development of formal arguments, most students
struggle to understand nondeterministic computation models. In part, the
struggle stems from the course exposing them for the first time to
nondeterminism. Often, students find it difficult to understand why a
nondeterministic machine accepts or rejects a word. Furthermore, they may feel
uncomfortable with there being multiple computations on the same input and with
a machine not consuming all of its input. This article describes a
visualization tool developed to help students understand nondeterministic
behavior. The tool is integrated into, FSM, a domain-specific language for the
Automata Theory classroom. The strategy is based on the automatic generation of
computation graphs given a machine and an input word. Unlike previous
visualization tools, the computation graphs generated reflect the structure of
the given machine's transition relation and not the structure of the
computation tree.Comment: Presented at The 2023 Scheme and Functional Programming Workshop
(arXiv:cs/0101200
Visualizing a Nondeterministic to Deterministic Finite-State Machine Transformation
The transformation of a nondeterministic finite-state automaton into a
deterministic finite-state automaton is an integral part of any course on
formal languages and automata theory. For some students, understanding this
transformation is challenging. Common problems encountered include not
comprehending how the states of the deterministic finite-state automaton are
determined and not comprehending the role that all the edges of the
nondeterministic finite-state automaton have in the deterministic finite-state
automaton's construction. To aid students in understanding, transformation
visualization tools have been developed. Although useful in helping students,
these tools do not properly illustrate the relationship between the states of
the deterministic finite-state automaton and the edges of the nondeterministic
finite-state automaton. This article presents a novel interactive visualization
tool to illustrate the transformation that highlights this relationship and
that is integrated into the FSM programming language. In addition, the
implementation of the visualization is sketched.Comment: Presented at The 2023 Scheme and Functional Programming Workshop
(arXiv:cs/0101200
Teaching how to program using automated assessment and functional glossy games (Experience Report)
Our department has long been an advocate of the functional-first school of programming and has been teaching Haskell as a first language in introductory programming course units for 20 years. Although the functional style is largely beneficial, it needs to be taught in an enthusiastic and captivating way to fight the unusually high computer science drop-out rates and appeal to a heterogeneous population of students.This paper reports our experience of restructuring, over the last 5 years, an introductory laboratory course unit that trains hands-on functional programming concepts and good software development practices. We have been using game programming to keep students motivated, and following a methodology that hinges on test-driven development and continuous bidirectional feedback. We summarise successes and missteps, and how we have learned from our experience to arrive at a model for comprehensive and interactive functional game programming assignments and a general functionally-powered automated assessment platform, that together provide a more engaging learning experience for students. In our experience, we have been able to teach increasingly more advanced functional programming concepts while improving student engagement.The authors would like to thank the precursors of the 20-year functional programming culture and FPro unit at our university, and all the instructors and TAs that have been involved in the PLab unit throughout the years. This work is financed by the ERDFs European Regional Development Fund through the Operational Programme for Competitiveness and Internationalisation - COMPETE 2020 Programme within project POCI-01-0145-FEDER-006961, and by National Funds through the Portuguese funding agency, FCT s Fundacao para a Ciencia e a Tecnologia as part of project UID/EEA/50014/2013
Improved Graph-Based Lambda Lifting
Abstract — Lambda lifting is a technique for transforming a program with local function definitions into a program consisting only of global function definitions. The best known lambda lifting algorithm computes the minimal set of extraneous parameters needed by each function in O(n 3) steps by solving a system of set equations which are recursive if the functions in the program are mutually recursive. Mutually recursive functions give rise to strongly connected components in the call graph of a program. Danvy and Schultz observed that all functions in a strongly connected component can be given the same set of free variables as extraneous parameters. Based on this observation, they developed an O(n 2) graph-based lambda lifting algorithm. This article illustrates how Danvy’s and Schultz’s algorithm is an approximation of Johnsson’s algorithm for a certain class of programs and describes an O(n 3) graph-based lambda lifting algorithm that yields the same results as Johnsson’s algorithm. I